package com.yaoli.niuke;

import java.util.Arrays;
import java.util.Scanner;

/**
 * Created by will on 2017/6/16.
 */
public class Sai01 {
    public static void main(String[] args) {
//        Scanner in = new Scanner(System.in);
//
//        int num = in.nextInt();
//
//        int array [] = new int[num];
//
//        for(int i = 0 ; i < num ; i++){
//            array[i] = in.nextInt();
//        }
        int array [] = {100,98,103,105};
        int num = 4;
        Arrays.sort(array);

        int max = Integer.MIN_VALUE;

        for(int i = 0 ; i < num - 2 ; i = i + 2){
            max = Math.max(max,Math.abs(array[i]-array[i+2]));
        }

        for(int i = num - 2; i >= 2 ; i = i - 2){
            max = Math.max(max,Math.abs(array[i]-array[i-2]));
        }

        max = Math.max(max,Math.abs(array[num - 1] - array[num -2]));

        System.out.println(max);

    }
}
